package com.cxs.shopstore.utils;

import com.cxs.shopstore.models.Good;
import org.springframework.stereotype.Component;

import java.util.Calendar;

/*
 * @Author:cxs
 * @Date:2021/5/9  9:57
 * @Version 1.0
 * */
@Component
public class GoodUtils {
    /**
     * 完善good对象
     * @param good
     * @return
     */
    public Good goodAdvice(Good good){
        long sku = Calendar.getInstance().getTimeInMillis();
        if(good.getGoodSku() == null){
            good.setGoodSku(sku);
        }
        if(good.getGoodCreateTime() == null){
            good.setGoodCreateTime(sku);
        }
        return good;
    }
}
